<!--#include file="../../core/common/Conn.asp" -->
<!--#include file="../../core/common/Limit.asp" -->
<%
	dim action
	action = request.QueryString("action")
	if action = "del" then
		call del
	end if
	
	'删除用户
	sub del
		dim ID,USERNAME
		
		ID = request.QueryString("id")
		USERNAME = request.Cookies("USERINFO")("USERNAME")
		
		db.execute("delete from [USERS] where ID = "& ID &" and USERNAME <> '"& USERNAME &"'")
		response.Redirect("list.asp")
	end sub
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMSLite for ASP</title>
<link href="../resource/css/reset.css" rel="stylesheet" type="text/css" />
<link href="../resource/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../resource/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../resource/js/common.js"></script>
</head>

<body>
<div class="bottom_bar">
<input type="button" class="button" value="新增" onclick="location.href='add.asp';" />
</div>
<table border="0" cellspacing="0" cellpadding="0" class="table_style_1">
	<thead>
		<tr>
			<th width="200">用户名</th>
			<th>姓名</th>
			<th width="84">修改</th>
			<th width="84">删除</th>
		</tr>
	</thead>
	<tbody>
	<%
		dim sql,rs
		sql = "select * from [USERS] order by ID asc"
		set rs = db.query(sql)
		if not rs.eof then
			do while not rs.eof
	%>
		<tr>
			<td class="main"><a href="edit.asp?id=<%=rs("ID")%>"><%=rs("USERNAME")%></a></td>
			<td><%=rs("NAME")%></td>
			<td><a href="edit.asp?id=<%=rs("ID")%>">修改</a></td>
			<td><a href="?action=del&id=<%=rs("ID")%>">删除</a></td>
		</tr>
	<%
				rs.movenext
			loop
		end if
		rs.close
		set rs = nothing
	%>
	</tbody>
</table>
</body>
</html>
